package cn.bdqn.util;

import cn.bdqn.vo.AllHotelMessageVO;
import cn.bdqn.vo.ItripHotelOrderEx;

import java.util.List;

/**
 * 分页工具
 * Created by Administrator on 2018/7/16.
 */
public class PageUtil {

    /**
     * 当前页   外部传入
     */
    private long currentPage;

    /**
     * 共几页
     */
    private long pageNums;

    /**
     * 页容量
     */
    private long pageSize;

    /**
     * 总记录数  外部传入
     */
    private long totalRecords;

    /**
     * 查询条件  外部传入
     */
    private ItripHotelOrderEx itripHotelOrderEx;


    /**
     * 查询条件
     */
    private AllHotelMessageVO allHotelMessageVO;


    /**
     * 查询结果集合 外部传入
     */
    private List<?> list;

    /**
     * 起始记录数
     */
    private long startIndex;

    /**
     * 结束记录数
     */
    private long endIndex;

    /**
     * 用户查询的模块路径
     */
    private String queryPath;

    public String getQueryPath() {
        return queryPath;
    }

    public void setQueryPath(String queryPath) {
        this.queryPath = queryPath;
    }

    public PageUtil(long currentPage, long totalRecords, ItripHotelOrderEx itripHotelOrderEx) {
        this.currentPage = currentPage;
        this.totalRecords = totalRecords;
        this.itripHotelOrderEx = itripHotelOrderEx;
        this.pageNums = totalRecords % pageSize == 0 ? totalRecords / pageSize : totalRecords / pageSize + 1;
        if (totalRecords == 0) {
            this.pageNums = 1;
        }
        this.startIndex = (currentPage - 1) * pageSize;
        new Long(pageSize);
        this.endIndex = currentPage * pageSize;
    }

    public long getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(long currentPage) {
        this.currentPage = currentPage;
    }

    public ItripHotelOrderEx getItripHotelOrderEx() {
        return itripHotelOrderEx;
    }

    public void setItripHotelOrderEx(ItripHotelOrderEx itripHotelOrderEx) {
        this.itripHotelOrderEx = itripHotelOrderEx;
    }

    public List<?> getList() {
        return list;
    }

    public void setList(List<?> list) {
        this.list = list;
    }

    public long getPageNums() {
        return pageNums;
    }

    public void setPageNums(long pageNums) {
        this.pageNums = pageNums;
    }

    public long getPageSize() {
        return pageSize;
    }

    public void setPageSize(long pageSize) {
        this.pageSize = pageSize;
    }

    public long getEndIndex() {
        return endIndex;
    }

    public void setEndIndex(long endIndex) {
        this.endIndex = endIndex;
    }

    public long getStartIndex() {
        return startIndex;
    }

    public void setStartIndex(long startIndex) {
        this.startIndex = startIndex;
    }

    public long getTotalRecords() {
        return totalRecords;
    }

    public void setTotalRecords(long totalRecords) {
        this.totalRecords = totalRecords;
    }

    public AllHotelMessageVO getAllHotelMessageVO() {
        return allHotelMessageVO;
    }

    public void setAllHotelMessageVO(AllHotelMessageVO allHotelMessageVO) {
        this.allHotelMessageVO = allHotelMessageVO;
    }
}
